package com.gewu.ordlelist.utils;

import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.view.View;

import androidx.appcompat.app.AlertDialog;

import com.gewu.ordlelist.R;

public class jocUtils {

    public static String name;
    private static int[] images = {R.drawable.four, R.drawable.five, R.drawable.six, R.drawable.seven, R.drawable.eight, R.drawable.night};
    private static int[] texts = {R.string.name1, R.string.name2,R.string.name3,R.string.name4,R.string.name5,R.string.name6,R.string.name7,R.string.name8,R.string.name9,
            R.string.name10,R.string.name11, R.string.name12,R.string.name13,R.string.name14,R.string.name15,R.string.name16,R.string.name17,R.string.name18,R.string.name19,R.string.name20};


    public static int[] getnames(){
        return texts;
    }


    public static int[] getimgs(){
        return images;
    }


    public static AlertDialog.Builder showDilog(Context context, String name, String content) {
        AlertDialog.Builder alertDialog1 = new AlertDialog.Builder(context);
        alertDialog1.setTitle(name);
        alertDialog1.setMessage(content);//内容
        alertDialog1.create();
        return alertDialog1;
    }

    public static void isok(Context context, boolean f) {
        SharedPreferences preferences = context.getSharedPreferences("a", Context.MODE_PRIVATE);
        SharedPreferences.Editor editor = preferences.edit();
        editor.putBoolean("is", f);
        editor.apply();
    }


    public static boolean isno(Context context) {
        SharedPreferences preferences = context.getSharedPreferences("a", Context.MODE_PRIVATE);
        boolean is = preferences.getBoolean("is", false);
        return is;
    }
}
